//
// [Author] lg (https://github.com/lemos1235)
// [Date] 2024/12/19
//
import 'package:go_router/go_router.dart';
import 'package:koner/screens/main_screen.dart';
import 'package:provider/provider.dart';

import 'common/palette.dart';
import 'screens/level_selection/level_selection_screen.dart';
import 'utils/page_transition.dart';

final router = GoRouter(
  routes: [
    GoRoute(
      path: '/',
      builder: (context, state) => const MainScreen(),
      routes: [
        GoRoute(
          path: 'play',
          pageBuilder: (context, state) => buildPageTransition<void>(
            color: context.watch<Palette>().backgroundLevelSelection.color,
            child: const LevelSelectionScreen(),
          ),
        ),
      ],
    ),
  ],
);
